package baiqi.sishen.community.enums;

public enum NotificationTypeEnum {
    REPlY_QUESTION(0, "回复了你的问题"),
    REPLY_COMMENT(1, "回复了你的评论"),
    THUMB_COMMENT(2, "点赞了你的评论"),
    COLLECT_QUESTION(3,"收藏了你的问题");

    private Integer type;
    private String content;

    NotificationTypeEnum(Integer type, String content) {
        this.type = type;
        this.content = content;
    }

    public Integer getType() {
        return type;
    }

    public String getContent() {
        return content;
    }

    /**
     * 根据type 获取content
     *
     * @param type type
     * @return String
     */
    public static String contentOfType(Integer type) {
        for (NotificationTypeEnum value : NotificationTypeEnum.values()) {
            if (value.getType() == type) {
                return value.getContent();
            }
        }
        return "";
    }
}
